package com.xksms.miniotest.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.oas.annotations.EnableOpenApi;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @ClassName Knife4jConfiguration
 * @Description Swagger3 配置
 * @author 程超
 * @Date 2022/8/4 17:22
 */
@Configuration
@EnableOpenApi
public class Knife4jConfiguration {

    @Bean(value = "defaultApi3")
    public Docket defaultApi2() {
        Docket docket=new Docket(DocumentationType.OAS_30)
                .apiInfo(new ApiInfoBuilder()
                        //.title("swagger-bootstrap-ui-demo RESTful APIs")
                        .description("minio 的集成以及 图片的 打水印以及压缩")
                        .contact(new Contact("chengchao","https://gitee.com/xksms",""))
                        .version("1.0")
                        .build())
                //分组名称
                .groupName("3.0版本")
                .select()
                //这里指定Controller扫描包路径
                .apis(RequestHandlerSelectors.basePackage("com.xksms.miniotest.controller"))
                .paths(PathSelectors.any())
                .build();
        return docket;
    }
}